parse{
  SAXParserFactory factory=SAXParserFactory.newInstance();
  factory.setValidating(true);
  if (beansXml == null) {
    throw new org.jboss.weld.exceptions.IllegalStateException(LOAD_ERROR,"unknown");
  SAXParser parser;
  try {
    parser=factory.newSAXParser();
 catch (  SAXException e) {
    throw new DeploymentUnitProcessingException(e);
catch (  ParserConfigurationException e) {
    throw new DeploymentUnitProcessingException(e);
  InputStream beansXmlInputStream=null;
  try {
    beansXmlInputStream=beansXml.openStream();
    InputSource source=new InputSource(beansXmlInputStream);
    if (source.getByteStream().available() == 0) {
    BeansXmlHandler handler=new BeansXmlHandler(beansXml,propertyReplacer);
    try {
 catch (    SAXNotRecognizedException e) {
catch (    SAXNotSupportedException e) {
    parser.parse(source,handler);
    return handler.createBeansXml();
 catch (  IOException e) {
catch (  SAXException e) {
    if (beansXmlInputStream != null) {
      try {
        beansXmlInputStream.close();
 catch (      IOException e) {
}
parse{
  List<Metadata<String>> alternativeStereotypes=new ArrayList<Metadata<String>>();
  List<Metadata<String>> alternativeClasses=new ArrayList<Metadata<String>>();
  List<Metadata<String>> decorators=new ArrayList<Metadata<String>>();
  List<Metadata<String>> interceptors=new ArrayList<Metadata<String>>();
  List<Metadata<Filter>> includes=new ArrayList<Metadata<Filter>>();
  List<Metadata<Filter>> excludes=new ArrayList<Metadata<Filter>>();
  for (  URL url : urls) {
    alternativeStereotypes.addAll(beansXml.getEnabledAlternativeStereotypes());
    alternativeClasses.addAll(beansXml.getEnabledAlternativeClasses());
    decorators.addAll(beansXml.getEnabledDecorators());
    interceptors.addAll(beansXml.getEnabledInterceptors());
    includes.addAll(beansXml.getScanning().getIncludes());
    excludes.addAll(beansXml.getScanning().getExcludes());
  return new BeansXmlImpl(alternativeClasses,alternativeStereotypes,decorators,interceptors,new ScanningImpl(includes,excludes));
}
loadXsds{
  List<InputSource> xsds=new ArrayList<InputSource>();
  InputSource weldXsd=loadXsd("beans_1_1.xsd",BeansXmlParser.class.getClassLoader());
  InputSource cdiXsd=loadXsd("beans_1_0.xsd",BeanManager.class.getClassLoader());
  if (weldXsd != null) {
    xsds.add(weldXsd);
  if (cdiXsd != null) {
    xsds.add(cdiXsd);
  return xsds.toArray(EMPTY_INPUT_SOURCE_ARRAY);
}
loadXsd{
  InputStream in=classLoader.getResourceAsStream(name);
  if (in == null) {
    return null;
    return new InputSource(in);
}
